package com.fastCms.business.bim.enums;

public enum ReportTypeEnum {
    TPF("TPF", "碳排放报告"),
    TZJ("TZJ", "碳足迹报告"),
    COMPANY("COMPANY", "企业信息");

    private String type;
    private String name;

    ReportTypeEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public static ReportTypeEnum getEnum(String type) {
        for (ReportTypeEnum item : ReportTypeEnum.values()) {
            if (item.type.equals(type)) {
                return item;
            }
        }
        return null;
    }

    /**
     * 根据code获取name
     *
     * @param type
     * @return
     */
    public static String getName(String type) {
        ReportTypeEnum item = getEnum(type);
        return item != null ? item.name : null;
    }


    public String getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}
